package com.baor.demo;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

public class Main {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        MyThread m1 = new MyThread();
        m1.start();

        MyThread2 m2 = new MyThread2();
        Thread t1=  new Thread(m2,"线程二");
        t1.start();

        MyThread3 m3 = new MyThread3();
        FutureTask<String> ft = new FutureTask<>(m3);
        Thread t2 = new Thread(ft);
        t2.start();
        String retValue = ft.get();
        System.out.println(retValue);
    }
}
